package com.javaGather.day4;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        /**
         * 增强for循环
         * for(类型 变量名称：集合或数组){
         *     变量名称
         * }
         *
         */
        int[] arr = {1,2,3,4,5,6,7,8,9,10};
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        System.out.println("增强for循环");
        for (int j : arr) {
            System.out.println(j);
        }

        String[] strArr = {"1","2","3","4","5"};
        for(String str : strArr) {
            System.out.println(str);
        }

        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("1");
        for (String str : arrayList) {
            System.out.println(str);
        }
    }
}
